<template>
  <div class="login-bg">
    <div class="bg-cyber-deep"></div>
    <div class="bg-cyber-mid"></div>
    <div class="bg-cyber-light"></div>
    <div class="bg-cyber-glow"></div>
    <div class="bg-cyber-oval"></div>
    <div class="bg-cyber-poly"></div>
    <div class="bg-block"></div>
    <div class="bg-ellipse"></div>
    <div class="bg-rect"></div>
    <div class="bg-blur"></div>
    <div class="login-center-card">
      <!-- 左侧表单 -->
      <div class="login-form-panel">
        <div class="logo-center">
          <el-icon :size="48" color="#1976d2"><School /></el-icon>
          <h1>智慧校园门户</h1>
          <p class="subtitle">Smart Campus Portal</p>
        </div>
        <!-- 顶部tab切换 -->
        <div class="form-tabs">
          <span :class="{active: activeTab === 1}" @click="switchTab(1)">登录</span>
          <span :class="{active: activeTab === 2}" @click="switchTab(2)">注册</span>
          <span :class="{active: activeTab === 0}" @click="switchTab(0)">找回密码</span>
        </div>
        <!-- 表单滑动切换 -->
        <transition :name="slideName" mode="out-in">
          <div :key="activeTab">
            <!-- 找回密码 -->
            <el-form
              v-if="activeTab === 0"
              :model="forgotForm"
              :rules="forgotRules"
              ref="forgotFormRef"
              label-width="80px"
              class="form-content"
            >
              <el-form-item label="邮箱" prop="email">
                <el-input v-model="forgotForm.email" autocomplete="email" />
              </el-form-item>
              <el-form-item label="验证码" prop="captcha">
                <div class="captcha-row">
                  <el-input v-model="forgotForm.captcha" maxlength="6" />
                  <el-button @click="sendEmailCaptcha" :disabled="!forgotForm.email" size="small" style="margin-left:8px">发送验证码</el-button>
                </div>
              </el-form-item>
              <el-form-item label="新密码" prop="newPassword">
                <el-input v-model="forgotForm.newPassword" type="password" autocomplete="new-password" />
              </el-form-item>
              <el-form-item>
                <el-button type="primary" @click="onForgot" :loading="forgotLoading">重置密码</el-button>
              </el-form-item>
            </el-form>
            <!-- 登录 -->
            <el-form
              v-else-if="activeTab === 1"
              :model="loginForm"
              :rules="loginRules"
              ref="loginFormRef"
              label-width="80px"
              class="form-content"
            >
              <el-form-item label="用户名" prop="username">
                <el-input v-model="loginForm.username" autocomplete="username" />
              </el-form-item>
              <el-form-item label="密码" prop="password">
                <el-input v-model="loginForm.password" type="password" autocomplete="current-password" />
              </el-form-item>
              <el-form-item label="验证码" prop="captcha">
                <div class="captcha-row">
                  <el-input v-model="loginForm.captcha" maxlength="6" />
                  <img :src="captchaImg" @click="refreshCaptcha" class="captcha-img" alt="captcha" />
                </div>
              </el-form-item>
              <el-form-item label="身份" prop="role">
                <el-select v-model="loginForm.role" placeholder="请选择身份">
                  <el-option label="学生" value="STUDENT" />
                  <el-option label="教师" value="TEACHER" />
                  <el-option label="后勤" value="STAFF" />
                  <el-option label="管理员" value="ADMIN" />
                </el-select>
              </el-form-item>
              <el-form-item>
                <el-button type="primary" @click="onLogin" :loading="loginLoading">登录</el-button>
              </el-form-item>
            </el-form>
            <!-- 注册 -->
            <el-form
              v-else
              :model="registerForm"
              :rules="registerRules"
              ref="registerFormRef"
              label-width="80px"
              class="form-content"
            >
              <el-form-item label="用户名" prop="username">
                <el-input v-model="registerForm.username" autocomplete="username" />
              </el-form-item>
              <el-form-item label="邮箱" prop="email">
                <el-input v-model="registerForm.email" autocomplete="email" />
              </el-form-item>
              <el-form-item label="密码" prop="password">
                <el-input v-model="registerForm.password" type="password" autocomplete="new-password" />
              </el-form-item>
              <el-form-item label="确认密码" prop="confirmPassword">
                <el-input v-model="registerForm.confirmPassword" type="password" autocomplete="new-password" />
              </el-form-item>
              <el-form-item label="验证码" prop="captcha">
                <div class="captcha-row">
                  <el-input v-model="registerForm.captcha" maxlength="6" />
                  <img :src="captchaImg" @click="refreshCaptcha" class="captcha-img" alt="captcha" />
                </div>
              </el-form-item>
              <el-form-item label="身份" prop="role">
                <el-select v-model="registerForm.role" placeholder="请选择身份">
                  <el-option label="学生" value="STUDENT" />
                  <el-option label="教师" value="TEACHER" />
                  <el-option label="后勤" value="STAFF" />
                  <el-option label="管理员" value="ADMIN" />
                </el-select>
              </el-form-item>
              <el-form-item>
                <el-button type="primary" @click="onRegister" :loading="registerLoading">注册</el-button>
              </el-form-item>
            </el-form>
          </div>
        </transition>
      </div>
      <!-- 右侧轮播+欢迎语 -->
      <div class="login-carousel-panel">
        <el-carousel class="side-carousel" :interval="5000" arrow="never" height="100%">
          <el-carousel-item v-for="(img, idx) in bgImages" :key="idx">
            <img :src="img" class="side-bg-img" />
          </el-carousel-item>
        </el-carousel>
        <div class="banner-mask"></div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted, computed } from 'vue'
import { useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
import { School } from '@element-plus/icons-vue'
import { login, register, getCaptcha, forgotPassword, resetPassword } from '@/api/user'
import store from '@/store'

const router = useRouter()
const activeTab = ref(1)
const lastTab = ref(activeTab.value)
const bgImages = [
  require('@/assets/bg1.jpg'),
  require('@/assets/bg2.jpg'),
  require('@/assets/bg3.jpg')
]

// 登录表单
const loginFormRef = ref()
const loginLoading = ref(false)
const loginForm = ref({
  username: '',
  password: '',
  role: '',
  captcha: '',
  captchaId: ''
})
const loginRules = {
  username: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
  password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
  role: [{ required: true, message: '请选择身份', trigger: 'change' }],
  captcha: [{ required: true, message: '请输入验证码', trigger: 'blur' }]
}

// 注册表单
const registerFormRef = ref()
const registerLoading = ref(false)
const registerForm = ref({
  username: '',
  password: '',
  confirmPassword: '',
  role: '',
  email: '',
  captcha: '',
  captchaId: ''
})
const registerRules = {
  username: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
  password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
  confirmPassword: [
    { required: true, message: '请确认密码', trigger: 'blur' },
    { validator: (rule, value, callback) => {
        if (value !== registerForm.value.password) {
          callback(new Error('两次输入的密码不一致'))
        } else {
          callback()
        }
      }, trigger: 'blur' }
  ],
  role: [{ required: true, message: '请选择身份', trigger: 'change' }],
  email: [
    { required: true, message: '请输入邮箱', trigger: 'blur' },
    { type: 'email', message: '邮箱格式不正确', trigger: 'blur' }
  ],
  captcha: [{ required: true, message: '请输入验证码', trigger: 'blur' }]
}

// 找回密码表单
const forgotFormRef = ref()
const forgotLoading = ref(false)
const forgotForm = ref({
  email: '',
  captcha: '',
  newPassword: ''
})
const forgotRules = {
  email: [
    { required: true, message: '请输入邮箱', trigger: 'blur' },
    { type: 'email', message: '邮箱格式不正确', trigger: 'blur' }
  ],
  captcha: [{ required: true, message: '请输入验证码', trigger: 'blur' }],
  newPassword: [{ required: true, message: '请输入新密码', trigger: 'blur' }]
}

// 验证码图片
const captchaImg = ref('')
const refreshCaptcha = async () => {
  const res = await getCaptcha()
  captchaImg.value = res.data.img
  loginForm.value.captchaId = res.data.captchaId
  registerForm.value.captchaId = res.data.captchaId
}
onMounted(() => {
  refreshCaptcha()
})

const onLogin = () => {
  loginFormRef.value.validate(async valid => {
    if (!valid) return
    loginLoading.value = true
    try {
      // 添加调试日志
      console.log('Login payload:', loginForm.value)

      const res = await login(loginForm.value)
      console.log('Login response:', res)

      if (res.code === 200) {
        ElMessage.success('登录成功')

        // 直接使用登录返回的用户信息
        const userData = res.data.userInfo
        const token = res.data.token

        // 设置用户信息（使用后端返回的基本信息）
        const userInfo = {
          id: userData.id,
          username: userData.username,
          name: userData.realName || userData.name,
          realName: userData.realName,
          role: userData.role,
          avatar: userData.avatar || '',
          email: userData.email || '',
          phone: userData.phone || '',
          permissions: userData.permissions || []
        }

        console.log('Login - userInfo to store:', userInfo)
        console.log('Login - token:', token)
        console.log('Login - user role:', userInfo.role)
        
        // 调用store的login action来设置完整的用户信息和token
        await store.dispatch('user/login', {
          token: token,
          user: userInfo
        })

        console.log('Login - after store dispatch, store state:', store.state.user)

        router.push('/dashboard')
      } else {
        ElMessage.error(res.message || '登录失败')
        refreshCaptcha()
      }
    } catch (e) {
      console.error('Login error:', e)
      ElMessage.error('登录异常')
      refreshCaptcha()
    } finally {
      loginLoading.value = false
    }
  })
}

const onRegister = () => {
  registerFormRef.value.validate(async valid => {
    if (!valid) return
    registerLoading.value = true
    try {
      const { confirmPassword, ...form } = registerForm.value
      void confirmPassword // 用一次，消除 ESLint 报错
      const res = await register(form)
      if (res.code === 200) {
        ElMessage.success('注册成功，已自动登录')
        // 自动登录：保存token和用户信息
        const userData = res.data.userInfo
        const token = res.data.token
        const userInfo = {
          id: userData.id,
          username: userData.username,
          name: userData.realName || userData.name,
          realName: userData.realName,
          role: userData.role,
          avatar: userData.avatar || '',
          email: userData.email || '',
          phone: userData.phone || '',
          permissions: userData.permissions || []
        }
        await store.dispatch('user/login', {
          token: token,
          user: userInfo
        })
        router.push('/dashboard')
      } else {
        ElMessage.error(res.message || '注册失败')
        refreshCaptcha()
      }
    } catch (e) {
      ElMessage.error('注册异常')
      refreshCaptcha()
    } finally {
      registerLoading.value = false
    }
  })
}

const onForgot = () => {
  forgotFormRef.value.validate(async valid => {
    if (!valid) return
    forgotLoading.value = true
    try {
      const res = await resetPassword(forgotForm.value)
      if (res.code === 200) {
        ElMessage.success('密码已重置，请登录')
        switchTab(1)
      } else {
        ElMessage.error(res.message || '重置失败')
      }
    } catch (e) {
      ElMessage.error('重置异常')
    } finally {
      forgotLoading.value = false
    }
  })
}

const sendEmailCaptcha = async () => {
  console.log('点击了发送了验证码')
  if (!forgotForm.value.email) {
    ElMessage.warning('请先输入邮箱')
    return
  }
  try {
    const res = await forgotPassword({ email: forgotForm.value.email })
    if (res.code === 200) {
      ElMessage.success('验证码已发送到邮箱')
    } else {
      ElMessage.error(res.message || '发送失败')
    }
  } catch (e) {
    ElMessage.error('发送异常')
  }
}

const slideName = computed(() => {
  if (activeTab.value > lastTab.value) return 'slide-left'
  if (activeTab.value < lastTab.value) return 'slide-right'
  return 'slide-fade'
})
function switchTab(idx) {
  lastTab.value = activeTab.value
  activeTab.value = idx
}
</script>

<style lang="scss" scoped>
.login-bg {
  min-height: 100vh;
  background: linear-gradient(120deg, #1976d2 0 55%, #fff 55% 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-bg::before {
  content: '';
  position: absolute;
  left: -120px;
  top: -80px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle at 60% 40%, #1976d2 0%, #1565c0 80%, transparent 100%);
  opacity: 0.32;
  border-radius: 50%;
  z-index: 0;
}
.login-bg::after {
  content: '';
  position: absolute;
  right: -100px;
  bottom: -120px;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle at 40% 60%, #42a5f5 0%, #1976d2 80%, transparent 100%);
  opacity: 0.22;
  border-radius: 50%;
  z-index: 0;
}
.login-bg .bg-block {
  position: absolute;
  left: 60px;
  bottom: 60px;
  width: 100px;
  height: 60px;
  background: linear-gradient(100deg, #1565c0 0%, #1976d2 100%);
  opacity: 0.13;
  border-radius: 32px 60px 40px 80px;
  z-index: 1;
}
.login-bg .bg-ellipse {
  position: absolute;
  left: -220px;
  top: -40px;
  width: 380px;
  height: 140px;
  background: radial-gradient(ellipse at 60% 40%, #42a5f5 0%, #1976d2 80%, transparent 100%);
  opacity: 0.18;
  filter: blur(2px);
  border-radius: 50% 40% 60% 50% / 60% 50% 40% 50%;
  z-index: 0;
}
.login-bg .bg-rect {
  position: absolute;
  left: -60px;
  bottom: -40px;
  width: 200px;
  height: 70px;
  background: linear-gradient(100deg, #42a5f5 0%, #90caf9 100%);
  opacity: 0.13;
  border-radius: 24px 60px 40px 80px;
  transform: rotate(-8deg);
  z-index: 1;
}
.login-bg .bg-blur {
  position: absolute;
  right: -100px;
  bottom: -60px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, #fff 0%, #90caf9 80%, transparent 100%);
  opacity: 0.13;
  filter: blur(12px);
  border-radius: 50%;
  z-index: 1;
}
.login-center-card {
  width: 1100px;
  height: 720px;
  background: #fff;
  border-radius: 40px;
  box-shadow: 0 8px 40px 0 rgba(25, 118, 210, 0.13);
  display: flex;
  overflow: hidden;
  z-index: 10;
  transition: box-shadow 0.3s, transform 0.3s;
}
.login-center-card:hover {
  box-shadow: 0 16px 56px 0 rgba(25, 118, 210, 0.18);
  transform: scale(1.012);
}
.login-form-panel {
  flex: 1.1;
  padding: 56px 48px 40px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff;
  border-top-left-radius: 40px;
  border-bottom-left-radius: 40px;
}
.form-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
  gap: 32px;
  span {
    font-size: 1.15rem;
    color: #1976d2;
    font-weight: 600;
    cursor: pointer;
    padding-bottom: 6px;
    border-bottom: 2.5px solid transparent;
    letter-spacing: 1px;
    transition: border 0.2s, color 0.2s, box-shadow 0.2s, background 0.2s, transform 0.2s;
    border-radius: 8px 8px 0 0;
    font-family: 'Segoe UI', 'PingFang SC', 'Hiragino Sans', 'Arial', sans-serif;
    &.active {
      color: #0d47a1;
      border-bottom: 2.5px solid #1976d2;
      background: linear-gradient(90deg, #e3f2fd 0%, #fff 100%);
      border-radius: 6px 6px 0 0;
      box-shadow: 0 4px 16px 0 rgba(25, 118, 210, 0.10);
      transform: translateY(-2px) scale(1.06);
    }
  }
}
.slide-left-enter-active, .slide-right-enter-active, .slide-fade-enter-active,
.slide-left-leave-active, .slide-right-leave-active, .slide-fade-leave-active {
  transition: all 0.5s cubic-bezier(.4,2,.6,1);
}
.slide-left-enter-from, .slide-right-leave-to {
  opacity: 0;
  transform: translateX(60px);
}
.slide-left-leave-to, .slide-right-enter-from {
  opacity: 0;
  transform: translateX(-60px);
}
.slide-fade-enter-from, .slide-fade-leave-to {
  opacity: 0;
  transform: scale(0.98);
}
.logo-center {
  text-align: center;
  margin-bottom: 36px;
  h1 {
    color: #1976d2;
    font-weight: bold;
    font-size: 2.2rem;
    margin: 10px 0 0 0;
    letter-spacing: 2px;
    font-family: 'Segoe UI', 'PingFang SC', 'Hiragino Sans', 'Arial', sans-serif;
  }
  .subtitle {
    background: linear-gradient(90deg, #90caf9 0%, #e3f2fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.08rem;
    margin-top: 4px;
    letter-spacing: 1px;
    font-family: 'Segoe UI', 'PingFang SC', 'Hiragino Sans', 'Arial', sans-serif;
  }
}
.form-content {
  margin-top: 12px;
}
.el-form-item__label {
  color: #1976d2;
  font-weight: 600;
  letter-spacing: 1px;
  font-family: 'Segoe UI', 'PingFang SC', 'Hiragino Sans', 'Arial', sans-serif;
}
.el-input__wrapper {
  border-radius: 24px !important;
  background: #f5faff !important;
  box-shadow: 0 2px 8px 0 rgba(25, 118, 210, 0.06);
  transition: box-shadow 0.2s, border 0.2s;
  border: 1.5px solid #e3f2fd;
}
.el-input__wrapper:hover, .el-input__wrapper:focus-within {
  box-shadow: 0 4px 16px 0 rgba(25, 118, 210, 0.13);
  border: 1.5px solid #90caf9;
}
.el-button--primary {
  background: linear-gradient(90deg, #1976d2 0%, #42a5f5 100%);
  border-radius: 24px;
  font-weight: bold;
  border: none;
  letter-spacing: 1px;
  box-shadow: 0 2px 8px 0 rgba(25, 118, 210, 0.10);
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
  font-size: 1.08rem;
  padding: 10px 0;
}
.el-button--primary:hover {
  background: linear-gradient(90deg, #1565c0 0%, #64b5f6 100%);
  box-shadow: 0 4px 16px 0 rgba(25, 118, 210, 0.18);
  transform: scale(1.04);
}
.el-link--primary {
  color: #1976d2;
}
.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
  .el-input {
    flex: 1;
  }
  .captcha-img {
    height: 38px;
    border-radius: 8px;
    box-shadow: 0 2px 8px 0 rgba(25, 118, 210, 0.10);
    border: 1.5px solid #e3f2fd;
    background: #fff;
    transition: box-shadow 0.2s, border 0.2s;
    cursor: pointer;
  }
  .captcha-img:hover {
    box-shadow: 0 4px 16px 0 rgba(25, 118, 210, 0.13);
    border: 1.5px solid #90caf9;
  }
}
.captcha-row .el-button,
.captcha-row .el-button--primary {
  width: 120px !important;
  min-width: 100px !important;
  height: 38px !important;
  border-radius: 6px !important;
  background: #e3f2fd !important;
  color: #1976d2 !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  box-shadow: none !important;
  border: 1.5px solid #bbdefb !important;
  margin-left: 8px !important;
  transition: background 0.18s, border 0.18s, color 0.18s;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
}
.captcha-row .el-button:hover,
.captcha-row .el-button--primary:hover {
  background: #bbdefb !important;
  color: #1565c0 !important;
  border: 1.5px solid #90caf9 !important;
}
.login-carousel-panel {
  flex: 1.2;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: transparent;
  border-top-right-radius: 40px;
  border-bottom-right-radius: 40px;
}
.side-carousel {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.side-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}
.banner-mask {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0.78) 0%, rgba(255,255,255,0.18) 100%);
  z-index: 2;
  pointer-events: none;
}
.el-form-item {
  display: flex;
  justify-content: center;
  align-items: center;
}
.el-form-item > .el-button,
.el-form-item > .el-button--primary,
.el-button,
.el-button--primary {
  position: relative;
  overflow: visible;
  width: 180px !important;
  min-width: 180px !important;
  max-width: 220px !important;
  height: 46px !important;
  border-radius: 8px !important;
  font-size: 1.18rem;
  font-weight: 700;
  background: linear-gradient(100deg, #42a5f5 0%, #1976d2 60%, #1565c0 100%);
  color: #fff !important;
  border: none !important;
  box-shadow: 0 4px 18px 0 rgba(25, 118, 210, 0.13);
  letter-spacing: 2px;
  transition: background 0.18s, box-shadow 0.18s, transform 0.16s, filter 0.16s;
  filter: drop-shadow(0 2px 8px #e3f2fd);
  outline: none;
  padding: 0 !important;
  margin: 0 auto !important;
  text-align: center;
  display: flex !important;
  align-items: center;
  justify-content: center;
  line-height: 46px !important;
  border-bottom: 2.5px solid #1976d2;
  border-top: 1.5px solid #90caf9;
  box-sizing: border-box;
  border-left: none;
  border-right: none;
  border-image: none;
  border-style: solid;
  border-width: 1.5px 0 2.5px 0;
  border-radius: 8px !important;
  font-family: 'Segoe UI', 'PingFang SC', 'Arial', sans-serif;
}
.el-form-item > .el-button--primary::before {
  content: '';
  position: absolute;
  pointer-events: none;
  left: -7px; top: -7px; right: -7px; bottom: -7px;
  z-index: 1;
  border-radius: 12px;
  opacity: 0.85;
  background: url('data:image/svg+xml;utf8,<svg width="100%25" height="100%25" viewBox="0 0 220 46" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8,38 Q30,8 60,23 T110,23 T160,23 T200,23 Q210,41 212,8" stroke="%233cb371" stroke-width="3" fill="none"/><circle cx="30" cy="18" r="3" fill="%234caf50"/><circle cx="190" cy="28" r="3" fill="%234caf50"/><ellipse cx="60" cy="23" rx="2" ry="4" fill="%233cb371"/><ellipse cx="160" cy="23" rx="2" ry="4" fill="%233cb371"/></svg>') center/cover no-repeat;
}
.el-form-item > .el-button--primary:hover,
.el-form-item > .el-button--primary:focus {
  background: linear-gradient(100deg, #1976d2 0%, #42a5f5 100%);
  box-shadow: 0 8px 32px 0 rgba(25, 118, 210, 0.18);
  transform: translateY(-2px) scale(1.045);
  filter: brightness(1.10) drop-shadow(0 4px 16px #e3f2fd);
}
@media (max-width: 600px) {
  .el-form-item > .el-button--primary {
    width: 100%;
    min-width: 0;
    font-size: 1rem;
    height: 42px;
  }
}
.bg-cyber-deep {
  position: absolute;
  left: -180px;
  top: -100px;
  width: 420px;
  height: 600px;
  background: linear-gradient(120deg, #0d47a1 60%, #1565c0 100%);
  opacity: 0.36;
  transform: skewY(-16deg) rotate(-8deg);
  border-radius: 180px 220px 180px 120px;
  filter: blur(2.5px);
  z-index: 0;
  pointer-events: none;
}
.bg-cyber-mid {
  position: absolute;
  left: 60px;
  top: 60px;
  width: 220px;
  height: 320px;
  background: linear-gradient(110deg, #1976d2 60%, #42a5f5 100%);
  opacity: 0.22;
  transform: skewX(-18deg) rotate(6deg);
  border-radius: 120px 180px 120px 80px;
  box-shadow: 0 12px 48px 0 rgba(33,150,243,0.13);
  z-index: 0;
  pointer-events: none;
}
.bg-cyber-light {
  position: absolute;
  left: 120px;
  top: 340px;
  width: 180px;
  height: 120px;
  background: linear-gradient(120deg, #42a5f5 60%, #90caf9 100%);
  opacity: 0.18;
  clip-path: polygon(0 0, 100% 10%, 80% 100%, 10% 80%);
  filter: blur(1.5px);
  z-index: 0;
  pointer-events: none;
}
.bg-cyber-glow {
  position: absolute;
  left: 220px;
  top: 180px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, #90caf9 0%, #42a5f5 80%, transparent 100%);
  opacity: 0.16;
  filter: blur(18px);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}
.bg-cyber-oval {
  position: absolute;
  left: 40px;
  bottom: 60px;
  width: 180px;
  height: 80px;
  background: linear-gradient(120deg, #1565c0 60%, #42a5f5 100%);
  opacity: 0.18;
  border-radius: 80px 60px 100px 60px;
  filter: blur(1.5px);
  z-index: 0;
  pointer-events: none;
}
.bg-cyber-poly {
  position: absolute;
  left: 220px;
  bottom: 40px;
  width: 120px;
  height: 80px;
  background: linear-gradient(120deg, #42a5f5 60%, #90caf9 100%);
  opacity: 0.13;
  clip-path: polygon(0 0, 100% 20%, 80% 100%, 10% 80%);
  filter: blur(1px);
  z-index: 0;
  pointer-events: none;
}
</style>